package com.fita.wechat.dao;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.fita.entity.data.Location;

/**
 * 
 * @author dan
 *
 */
@Dao("hibernate")
public interface LocationDao {
    
    /**
     * 
     * @param code
     * @return
     */
    @Query("FROM Location WHERE disabled = false AND code = :code")
    public Location load(@Variable("code") String code);

    @Query("FROM Location WHERE disabled = false AND hot = true AND country = :country AND supplier = :brand")
	public List<Location> listHotLocations(@Variable("country") String country, @Variable("brand") String brand);
    
    @Query("FROM Location WHERE disabled = false AND hot = true AND country IN (:countries) AND supplier = :brand")
	public List<Location> listHotLocations(@Variable("countries") String[] countries, @Variable("brand") String brand);

}
